<template>
	<view class="page" >
		<userMy  ref="useMy" v-if="tabberType==1"></userMy>
		<riderMy  ref="rierMy" v-if="tabberType==2"></riderMy>
		<tabBer v-if="tabberType==2" :typeOr="3"></tabBer>
	</view>
</template>
<script>
    import userMy from "../components/userMy/userMy.vue"
    import riderMy from "../components/riderMy/riderMy.vue"
	import tabBer from "../components/tabBar/tabBar.vue";
    export default {
        components: {riderMy,userMy,tabBer},


        data() {
            return {
                tabberType:1,
            };
        },
        computed: {
            
        },
        watch: {},
        onLoad(options) {

        },
        onUnload() {

        },
        onReady() {

        },
        onShow() {
			uni.showShareMenu({
				withShareTicket: true,
				//设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击
				menus: ["shareAppMessage"]
			})
			if(uni.getStorageSync('tabberType')){
				this.tabberType = uni.getStorageSync('tabberType')
				if(this.tabberType == 1){
					uni.showTabBar({
					  animation: true, // 是否需要动画效果
					  success: function () {
					    console.log('TabBar has been shown successfully.');
					    // 在这里编写显示后的逻辑
					  },
					  fail: function (err) {
					    console.error('Failed to show TabBar:', err);
					  }
					});
					uni.setTabBarItem({
					    index: 0, // tabIndex，下标从0开始
					    text: '首页', // 新的文字内容
					    success: function () {
					        console.log('Tab bar item text updated successfully!');
					    },
					    fail: function (err) {
					        console.error('Failed to update tab bar item text:', err);
					    }
					});
					this.$nextTick(() => {
						this.$refs.useMy.together();
					})
				}else{
					uni.hideTabBar()
					// 假设我们要修改第二个tab的文字
					uni.setTabBarItem({
						index: 0, // tabIndex，下标从0开始
						text: '抢单大厅', // 新的文字内容
						success: function () {
							console.log('Tab bar item text updated successfully!');
						},
						fail: function (err) {
							console.error('Failed to update tab bar item text:', err);
						}
					});
					this.$nextTick(() => {
						this.$refs.rierMy.together();
					})
				}
			}else{
				this.$nextTick(() => {
					this.$refs.useMy.together();
				})
			}
        },
        onHide() {

        },
        onResize() {

        },
        onPullDownRefresh() {

        },
        onReachBottom(e) {

        },
        onPageScroll(e) {

        },
        methods: {
         
        }
    };
</script>
<style lang="scss" scoped>
    
</style>